<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      The /usr Versus /usr/local Debate
    </title>
    <link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.79.1" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
  </head>
  <body class="blfs" id="blfs-9.1">
    <div class="navheader">
      <h4>
        Beyond Linux<sup>�</sup> From Scratch <span class="phrase">(System
        V</span> Edition) - Version 9.1
      </h4>
      <h3>
        Chapter&nbsp;2.&nbsp;Important Information
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="notes-on-building.html" title=
          "Notes on Building Software">Prev</a>
          <p>
            Notes on Building Software
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="patches.html" title=
          "Optional Patches">Next</a>
          <p>
            Optional Patches
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="important.html" title=
          "Chapter&nbsp;2.&nbsp;Important Information">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 9.1">Home</a>
        </li>
      </ul>
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="position" name="position"></a>The /usr Versus /usr/local
        Debate
      </h1>
      <p>
        <span class="emphasis"><em>Should I install XXX in <code class=
        "filename">/usr</code> or <code class=
        "filename">/usr/local</code>?</em></span>
      </p>
      <p>
        This is a question without an obvious answer for an LFS based system.
      </p>
      <p>
        In traditional Unix systems, <code class="filename">/usr</code>
        usually contains files that come with the system distribution, and
        the <code class="filename">/usr/local</code> tree is free for the
        local administrator to manage. The only really hard and fast rule is
        that Unix distributions should not touch <code class=
        "filename">/usr/local</code>, except perhaps to create the basic
        directories within it.
      </p>
      <p>
        With Linux distributions like Red Hat, Debian, etc., a possible rule
        is that <code class="filename">/usr</code> is managed by the
        distribution's package system and <code class=
        "filename">/usr/local</code> is not. This way the package manager's
        database knows about every file within <code class=
        "filename">/usr</code>.
      </p>
      <p>
        LFS users build their own system and so deciding where the system
        ends and local files begin is not straightforward. So the choice
        should be made in order to make things easier to administer. There
        are several reasons for dividing files between <code class=
        "filename">/usr</code> and <code class="filename">/usr/local</code>.
      </p>
      <div class="itemizedlist">
        <ul>
          <li class="listitem">
            <p>
              On a network of several machines all running LFS, or mixed LFS
              and other Linux distributions, <code class=
              "filename">/usr/local</code> could be used to hold packages
              that are common between all the computers in the network. It
              can be NFS mounted or mirrored from a single server. Here local
              indicates local to the site.
            </p>
          </li>
          <li class="listitem">
            <p>
              On a network of several computers all running an identical LFS
              system, <code class="filename">/usr/local</code> could hold
              packages that are different between the machines. In this case
              local refers to the individual computers.
            </p>
          </li>
          <li class="listitem">
            <p>
              Even on a single computer, <code class=
              "filename">/usr/local</code> can be useful if you have several
              distributions installed simultaneously, and want a place to put
              packages that will be the same on all of them.
            </p>
          </li>
          <li class="listitem">
            <p>
              Or you might regularly rebuild your LFS, but want a place to
              put files that you don't want to rebuild each time. This way
              you can wipe the LFS file system and start from a clean
              partition every time without losing everything.
            </p>
          </li>
        </ul>
      </div>
      <p>
        Some people ask why not use your own directory tree, e.g.,
        <code class="filename">/usr/site</code>, rather than <code class=
        "filename">/usr/local</code>?
      </p>
      <p>
        There is nothing stopping you, many sites do make their own trees,
        however it makes installing new software more difficult. Automatic
        installers often look for dependencies in <code class=
        "filename">/usr</code> and <code class="filename">/usr/local</code>,
        and if the file it is looking for is in <code class=
        "filename">/usr/site</code> instead, the installer will probably fail
        unless you specifically tell it where to look.
      </p>
      <p>
        <span class="emphasis"><em>What is the BLFS position on
        this?</em></span>
      </p>
      <p>
        All of the BLFS instructions install programs in <code class=
        "filename">/usr</code> with optional instructions to install into
        <code class="filename">/opt</code> for some specific packages.
      </p>
      <p class="updated">
        Last updated on 2007-04-04 12:42:53 -0700
      </p>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="notes-on-building.html" title=
          "Notes on Building Software">Prev</a>
          <p>
            Notes on Building Software
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="patches.html" title=
          "Optional Patches">Next</a>
          <p>
            Optional Patches
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="important.html" title=
          "Chapter&nbsp;2.&nbsp;Important Information">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 9.1">Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
